// Log.h: interface for the CLog class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LOG_H__FFC9FD7B_445B_4701_86C4_7911B51EA95D__INCLUDED_)
#define AFX_LOG_H__FFC9FD7B_445B_4701_86C4_7911B51EA95D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <sys/stat.h>
#include <fcntl.h>
#include <io.h>
#include <afxmt.h>
#define MAX_ROW 5000
class CLog
{
	public:
		void Disable();
		void Enable();
		CLog();
		~CLog();
		void WriteLogFile(const char* fmt, ... );
	protected:
		int NewLogFile(); 
		BOOL IsChangeDay();
		CString GetCurntTime();
		private:
		int m_filehandle;
		int m_row;
		int m_dirnum;
		int m_filenum;
		BOOL m_needlog;
		char m_sContent[1024*1024];
		CString m_strContent;
		CString m_sCurtTime;
		CString m_sYestady;
		CString m_sToday;
		CString m_sCurtDir;
		CString m_sLogDir;
		CString m_sLogDayDir;
		CCriticalSection m_cs;
};

#endif // !defined(AFX_LOG_H__FFC9FD7B_445B_4701_86C4_7911B51EA95D__INCLUDED_)
